#ifndef Z_LIGHT
#define Z_LIGHT

#include "stdafx.h"


    
class light{
public:
    inline light();
    inline void TurnOn();
    inline void TurnOff();
    inline bool getstatus();
    inline void Draw(CDC* pDC);
    inline void Setposation(int x,int y);
    inline void Getposation(int &x,int &y) const;
private:
    CBitmap m_lon ,m_loff;
    int X,Y;
    bool onoff;
};

light::light(){
    m_lon.LoadBitmapW(IDB_BITMAP4);
    m_loff.LoadBitmapW(IDB_BITMAP3);
    onoff = false;
}

void light::TurnOn(){
    onoff = true;

}

void light::TurnOff(){
    onoff = false;
}

bool light::getstatus(){
    return onoff;
    
}

void light::Setposation(int x, int y){
    X = x;
    Y = y;
}

void light::Getposation(int &x, int &y) const{
    x = X;
    y = Y;
}
    
void light::Draw(CDC *pDC){
    CDC MemDC;
    MemDC.CreateCompatibleDC (pDC);
    MemDC.SelectObject(&m_loff);
    if(onoff){
        MemDC.SelectObject(&m_lon);
    }
    pDC->BitBlt(X,Y,50,50,&MemDC,0,0,SRCCOPY);
    MemDC.DeleteDC();
    
    
}

#endif